//
//  XHFollowUsViewController.m
//  elxc
//
//  Created by 冷山 on 16/3/14.
//  Copyright © 2016年 lexingsoft. All rights reserved.
//

#import "XHFollowUsViewController.h"

#import "CSTestOptionViewController.h"

#import <UIAlertView+Blocks.h>

@interface XHFollowUsViewController ()
@property (weak, nonatomic) IBOutlet UIView *ui_view;
@property (weak, nonatomic) IBOutlet UILabel *ui_id;
@property (weak, nonatomic) IBOutlet UIImageView *ui_icon;

@end

@implementation XHFollowUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.ui_view.layer.masksToBounds = YES;
    self.ui_view.layer.cornerRadius = 10;
    
    self.ui_icon.layer.masksToBounds = YES;
    self.ui_icon.layer.cornerRadius = 37.5;
    
    NSString *shortVersion=[TakeInfoPlist CFBundle_ShortVersionString];
    NSString *version=[TakeInfoPlist CFBundle_Version];
    self.ui_id.text=[NSString stringWithFormat:@"优米巴士v%@",shortVersion];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)bgControlAction:(id)sender {
    static int touchCount=0;
    touchCount++;
    if (touchCount==11) {
        touchCount=0;
        CSTestOptionViewController *viewController=[[CSTestOptionViewController alloc] init];
        [self.navigationController pushViewController:viewController animated:YES];
    }
    DLog(@"touchCount:%d",touchCount);

}

- (IBAction)hotline:(id)sender
{
    NSString * phone = @"029-82309088";
    NSString *title=[NSString stringWithFormat:@"拨打客服热线:%@",phone];
    RIButtonItem *cancelItem=[RIButtonItem itemWithLabel:@"取消"];
    RIButtonItem *callItem=[RIButtonItem itemWithLabel:@"呼叫" action:^{
        NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",phone]];
        [[UIApplication sharedApplication] openURL:url];
    }];
    UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:title message:@"" cancelButtonItem:cancelItem otherButtonItems:callItem, nil];
    [alertView show];
}

- (IBAction)nationalHotline:(id)sender
{
    NSString * phone = @"400-808-3555";
    NSString *title=[NSString stringWithFormat:@"拨打全国热线:%@",phone];
    RIButtonItem *cancelItem=[RIButtonItem itemWithLabel:@"取消"];
    RIButtonItem *callItem=[RIButtonItem itemWithLabel:@"呼叫" action:^{
        NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",phone]];
        [[UIApplication sharedApplication] openURL:url];
    }];
    UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:title message:@"" cancelButtonItem:cancelItem otherButtonItems:callItem, nil];
    [alertView show];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
